﻿@model IEnumerable<MezmurStore2.Models.Album>

@{
    ViewBag.Title = "Index";
}

<h2>Mezmur Manager</h2>
<br />
<h3>
    @Html.ActionLink("Upload New Mezmur", "Create")
</h3>
<br />
@if (Model.Count() > 0)
{
    <fieldset>
        <legend style="color: White">Albums</legend>
        <table border=0 cellspacing="20">
    <tr>
        <th>
            Poster
        </th>
        <th>
            Title
        </th>
        <th>
            Gener
        </th>        
        <th>
            Track Count
        </th>
        <th>
            Action 
        </th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            <img src="@Url.Content(item.Poster)" alt="@item.Title" width="75" height="60" />
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Gener)
        </td>        
        <td>
            @Html.DisplayFor(modelItem => item.Tracks.Count)
        </td>
        <td>
            @Html.ActionLink("Update", "Edit", new { id = item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.Id })
        </td>
    </tr>
}

</table>
    </fieldset>
}
else
{
    <br />
    <p>You don't have any Mezmure Albums uploaded. Click Upload Mezmur.</p> 
}

<div style="width:800px;"/>